package com.neusoft.ruangong.other.config;

import com.neusoft.ruangong.other.handler.LoginHandlerInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author zhanglei
 * @create: 2021/07/01/22:50
 */
@Configuration
@Slf4j
public class MyMvcConfig implements WebMvcConfigurer {

//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new LoginHandlerInterceptor()).addPathPatterns("/*")
//                .excludePathPatterns("/", "/user/login", "/index.html", "/asserts/*");
//        WebMvcConfigurer.super.addInterceptors(registry);
//    }

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        log.info("这是视图控制器  addViewControllers...");
        registry.addViewController("/").setViewName("login");
        registry.addViewController("/index.html").setViewName("login");
    }


}
